﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Services
{
    public class ChooseActionServer : IChooseAction
    {
        public bool Insert(ChooseAction action)
        {
            if (action == null)
            {
                return false;
            }
            DB_ChooseAction db = new DB_ChooseAction();
            return db.InsertAction(action);
        }

        public bool Update(ChooseAction action)
        {
            if (action == null)
            {
                return false;
            }
            DB_ChooseAction db = new DB_ChooseAction();
            return db.UpdateAction(action);
        }

        public bool Delete(int id)
        {
            if (id>0)
            {
                DB_ChooseAction db = new DB_ChooseAction();
                return db.DeleteAction(id);
            }
            return false;
        }

        public List<ChooseAction> GetAllAction()
        {
            DB_ChooseAction db = new DB_ChooseAction();
            return db.GetAllAction();
        }
    }
}
